import request from '@/config/axios'

export const getProcessDefinition = async (id?: string, key?: string) => {
  return await request.get({
    url: '/bpm/process-definition/get',
    params: { id, key }
  })
}

export const getProcessDefinitionPage = async (params) => {
  return await request.get({
    url: '/bpm/process-definition/page',
    params
  })
}

export const getProcessDefinitionList = async (params) => {
  return await request.get({
    url: '/bpm/process-definition/list',
    params
  })
}

export const getSimpleProcessDefinitionList = async () => {
  return await request.get({
    url: '/bpm/process-definition/simple-list'
  })
}


// 获取流程实例的历史实例
export const getHistList = async (params: any) => {
  return await request.get({ url: '/bpm/process-definition/hist-list',params})
}
// 切换流程实例版本
export const migrationProcessDefinition = async (currentProcessDefinitionId?: string, fromProcessDefinitionId?: string) => {
  return await request.put({ url: '/bpm/process-definition/migrationProcessDefinition'+'/'+currentProcessDefinitionId+'/'+fromProcessDefinitionId})
}

